package com.zhiyou100.model;


import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;

import com.zhiyou100.validate.UserForget;
import com.zhiyou100.validate.UserLogin;
import com.zhiyou100.validate.UserRegister;

public class User implements Serializable{
	private Integer id;
	private String nick_name;
	private Integer sex;
	private Date birthday;
	
	@NotNull(groups= {UserRegister.class,UserLogin.class,UserForget.class},message="用户不能为空")
	@Email(groups= {UserRegister.class,UserLogin.class,UserForget.class},message="用户名必须为邮箱格式",regexp="^[\\w]+[\\w_]*@[\\w\\.]{2,10}\\.(com|cn)$")
	private String email;
	
	private String province;
	private String city;
	private String head_url;
	
	@Size(groups= {UserRegister.class,UserLogin.class},min=3,max=20,message="密码必须在6-20位之间")
	private String password;
	
	private Date insert_time;
	private Date update_time;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getNick_name() {
		return nick_name;
	}
	public void setNick_name(String nick_name) {
		this.nick_name = nick_name;
	}
	public Integer getSex() {
		return sex;
	}
	public void setSex(Integer sex) {
		this.sex = sex;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getProvince() {
		return province;
	}
	public void setProvince(String province) {
		this.province = province;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getHead_url() {
		return head_url;
	}
	public void setHead_url(String head_url) {
		this.head_url = head_url;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public Date getInsert_time() {
		return insert_time;
	}
	public void setInsert_time(Date insert_time) {
		this.insert_time = insert_time;
	}
	public Date getUpdate_time() {
		return update_time;
	}
	public void setUpdate_time(Date update_time) {
		this.update_time = update_time;
	}
	
	
	
}
